home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Interactive Reference Guide / C-C++ Interactive Reference Guide.iso / c_ref / csource5 / 310_01 / class.st < prev    next >
Text File  |  1990-04-20  |  1KB  |  50 lines

  1. Class Class
  2. [
  3.     edit
  4.         <ClassEdit self>
  5. |
  6.     list
  7.         <ClassList self>
  8. |
  9.      new        | superclass newinstance |
  10.         superclass <- <SuperClass self>.
  11.         <RespondsToNew superclass >
  12.             ifTrue: [newinstance <- superclass new ]. 
  13.         newinstance <- <ClassNew self newinstance >.
  14.         <RespondsTo self #new > 
  15.             ifTrue: [newinstance <- newinstance new].
  16.         ^ newinstance
  17. |
  18.      new: aValue         | superclass newinstance |
  19.         superclass <- <SuperClass self>.
  20.         <RespondsToNew superclass >
  21.             ifTrue: [newinstance <- superclass new ]. 
  22.         newinstance <- <ClassNew self newinstance >.
  23.         <RespondsTo self #new: > 
  24.             ifTrue: [newinstance <- newinstance new: aValue ].
  25.         ^ newinstance
  26. |
  27.      printString
  28.         ^ <ClassName self >
  29. |
  30.     respondsTo
  31.         <PrintMessages self>
  32. |
  33.     respondsTo: aSymbol        | aClass |
  34.         aClass <- self.
  35.         [aClass notNil] whileTrue:
  36.             [ <RespondsTo aClass aSymbol> ifTrue: [ ^ true ].
  37.              aClass <- aClass superClass ].
  38.         ^ false
  39. |
  40.     superClass
  41.         ^ <SuperClass self>
  42.  
  43. |
  44.     variables
  45.         ^ <Variables self>
  46. |
  47.     view
  48.         <ClassView self>
  49. ]
  50.